package round91;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class D {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String split[] = in.readLine().split(" ");
        int n = Integer.parseInt(split[0]), k = Integer.parseInt(split[1]);
        StringBuilder num = new StringBuilder(in.readLine());

        for (int i = 0, len = num.length(), c = 0; i < len - 1 && c < k; ) {
            if (num.charAt(i) == '4' && num.charAt(i + 1) == '7') {
                if ((i + 1) % 2 == 1) {
                    num.setCharAt(i + 1, '4');
                    i++;
                    c++;
                } else {
                    num.setCharAt(i, '7');
                    c++;
                    if (i - 1 >= 0 && num.charAt(i - 1) == '4') {
                        if ((k - c) % 2 == 1) {
                            num.setCharAt(i, '4');
                        }
                        i--;
                        break;
                    } else {
                        i += 2;
                    }
                }
            } else
                i++;
        }
        System.out.println(num.toString());
    }
}
